<!DOCTYPE html>


<html theme="dark" showBanner="true" hasBanner="true" > 
<link href="https://cdn.staticfile.org/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet">
<link href="https://cdn.staticfile.org/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet">
<link href="https://cdn.staticfile.org/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet">
<script src="/js/color.global.min.js" ></script>
<script src="/js/load-settings.js" ></script>
<head>
  <meta charset="utf-8">
  
  
  

  
  <title>树莓派基础配置及常见问题 | Li_Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <link rel="preload" href="/css/fonts/Roboto-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">
  <link rel="preload" href="/css/fonts/Roboto-Bold.ttf" as="font" type="font/ttf" crossorigin="anonymous">

  <meta name="description" content="一、安装树莓派系统及配置树莓派 下载树莓派系统  Raspberry Pi OS（Raspbian）：   下载地址  https:&#x2F;&#x2F;downloads.raspberrypi.org&#x2F;raspios_armhf_latest  默认账号：    Username: pi Password: raspberry  Ubuntu MATE for the Raspbe">
<meta property="og:type" content="article">
<meta property="og:title" content="树莓派基础配置及常见问题">
<meta property="og:url" content="http://example.com/2023/08/25/raspberry_one/index.html">
<meta property="og:site_name" content="Li_Blog">
<meta property="og:description" content="一、安装树莓派系统及配置树莓派 下载树莓派系统  Raspberry Pi OS（Raspbian）：   下载地址  https:&#x2F;&#x2F;downloads.raspberrypi.org&#x2F;raspios_armhf_latest  默认账号：    Username: pi Password: raspberry  Ubuntu MATE for the Raspbe">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-08-25T05:28:06.000Z">
<meta property="article:modified_time" content="2023-09-23T03:25:49.618Z">
<meta property="article:author" content="Xiaofeng Qiu">
<meta property="article:tag" content="树莓派配置">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="Li_Blog" type="application/atom+xml">
  
  
    <link rel="icon" media="(prefers-color-scheme: light)" href="/images/favicon-light-32.png" sizes="32x32">
    <link rel="icon" media="(prefers-color-scheme: light)" href="/images/favicon-light-128.png" sizes="128x128">
    <link rel="icon" media="(prefers-color-scheme: light)" href="/images/favicon-light-180.png" sizes="180x180">
    <link rel="icon" media="(prefers-color-scheme: light)" href="/images/favicon-light-192.png" sizes="192x192">
    <link rel="icon" media="(prefers-color-scheme: dark)" href="/images/favicon-dark-32.png" sizes="32x32">
    <link rel="icon" media="(prefers-color-scheme: dark)" href="/images/favicon-dark-128.png" sizes="128x128">
    <link rel="icon" media="(prefers-color-scheme: dark)" href="/images/favicon-dark-180.png" sizes="180x180">
    <link rel="icon" media="(prefers-color-scheme: dark)" href="/images/favicon-dark-192.png" sizes="192x192">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 6.3.0"><style>mjx-container[jax="SVG"] {
  direction: ltr;
}

mjx-container[jax="SVG"] > svg {
  overflow: visible;
}

mjx-container[jax="SVG"][display="true"] {
  display: block;
  text-align: center;
  margin: 1em 0;
}

mjx-container[jax="SVG"][justify="left"] {
  text-align: left;
}

mjx-container[jax="SVG"][justify="right"] {
  text-align: right;
}

g[data-mml-node="merror"] > g {
  fill: red;
  stroke: red;
}

g[data-mml-node="merror"] > rect[data-background] {
  fill: yellow;
  stroke: none;
}

g[data-mml-node="mtable"] > line[data-line] {
  stroke-width: 70px;
  fill: none;
}

g[data-mml-node="mtable"] > rect[data-frame] {
  stroke-width: 70px;
  fill: none;
}

g[data-mml-node="mtable"] > .mjx-dashed {
  stroke-dasharray: 140;
}

g[data-mml-node="mtable"] > .mjx-dotted {
  stroke-linecap: round;
  stroke-dasharray: 0,140;
}

g[data-mml-node="mtable"] > svg {
  overflow: visible;
}

[jax="SVG"] mjx-tool {
  display: inline-block;
  position: relative;
  width: 0;
  height: 0;
}

[jax="SVG"] mjx-tool > mjx-tip {
  position: absolute;
  top: 0;
  left: 0;
}

mjx-tool > mjx-tip {
  display: inline-block;
  padding: .2em;
  border: 1px solid #888;
  font-size: 70%;
  background-color: #F8F8F8;
  color: black;
  box-shadow: 2px 2px 5px #AAAAAA;
}

g[data-mml-node="maction"][data-toggle] {
  cursor: pointer;
}

mjx-status {
  display: block;
  position: fixed;
  left: 1em;
  bottom: 1em;
  min-width: 25%;
  padding: .2em .4em;
  border: 1px solid #888;
  font-size: 90%;
  background-color: #F8F8F8;
  color: black;
}

foreignObject[data-mjx-xml] {
  font-family: initial;
  line-height: normal;
  overflow: visible;
}

.MathJax path {
  stroke-width: 3;
}

mjx-container[display="true"] {
  overflow: auto hidden;
}

mjx-container[display="true"] + br {
  display: none;
}
</style></head>

<body>
  
  
    
<div id="banner" class="">
  <img src="https://pic.imgdb.cn/item/65099a9dc458853aef2eb85c.jpg" itemprop="image">
  <div id="banner-dim"></div>
</div>
 
   
  <div id="main-grid" class="  ">
    <div id="nav" class=""  >
      <navbar id="navbar">
  <nav id="title-nav">
    <a href="/">
      <div id="vivia-logo">
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
        <div class="dot"></div>
      </div>
      <div>Li_Blog </div>
    </a>
  </nav>
  <nav id="main-nav">
    
      <a class="main-nav-link" href="/">Home</a>
    
      <a class="main-nav-link" href="/archives">Archives</a>
    
      <a class="main-nav-link" href="/links">Links</a>
    
      <a class="main-nav-link" target="_blank" rel="noopener" href="https://15g4759r53.goho.co">Charge</a>
    
      <a class="main-nav-link" href="/game_2048">Game</a>
    
      <a class="main-nav-link" href="/about">About</a>
    
  </nav>
  <nav id="sub-nav">
    <a id="theme-btn" class="nav-icon">
      <span class="light-mode-icon"><svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M438.5-829.913v-48q0-17.452 11.963-29.476 11.964-12.024 29.326-12.024 17.363 0 29.537 12.024t12.174 29.476v48q0 17.452-11.963 29.476-11.964 12.024-29.326 12.024-17.363 0-29.537-12.024T438.5-829.913Zm0 747.826v-48q0-17.452 11.963-29.476 11.964-12.024 29.326-12.024 17.363 0 29.537 12.024t12.174 29.476v48q0 17.452-11.963 29.476-11.964 12.024-29.326 12.024-17.363 0-29.537-12.024T438.5-82.087ZM877.913-438.5h-48q-17.452 0-29.476-11.963-12.024-11.964-12.024-29.326 0-17.363 12.024-29.537t29.476-12.174h48q17.452 0 29.476 11.963 12.024 11.964 12.024 29.326 0 17.363-12.024 29.537T877.913-438.5Zm-747.826 0h-48q-17.452 0-29.476-11.963-12.024-11.964-12.024-29.326 0-17.363 12.024-29.537T82.087-521.5h48q17.452 0 29.476 11.963 12.024 11.964 12.024 29.326 0 17.363-12.024 29.537T130.087-438.5Zm660.174-290.87-34.239 32q-12.913 12.674-29.565 12.174-16.653-.5-29.327-13.174-12.674-12.673-12.554-28.826.12-16.152 12.794-28.826l33-35q12.913-12.674 30.454-12.674t30.163 12.847q12.709 12.846 12.328 30.826-.38 17.98-13.054 30.653ZM262.63-203.978l-32 34q-12.913 12.674-30.454 12.674t-30.163-12.847q-12.709-12.846-12.328-30.826.38-17.98 13.054-30.653l33.239-31q12.913-12.674 29.565-12.174 16.653.5 29.327 13.174 12.674 12.673 12.554 28.826-.12 16.152-12.794 28.826Zm466.74 33.239-32-33.239q-12.674-12.913-12.174-29.565.5-16.653 13.174-29.327 12.673-12.674 28.826-13.054 16.152-.38 28.826 12.294l35 33q12.674 12.913 12.674 30.454t-12.847 30.163q-12.846 12.709-30.826 12.328-17.98-.38-30.653-13.054ZM203.978-697.37l-34-33q-12.674-12.913-13.174-29.945-.5-17.033 12.174-29.707t31.326-13.293q18.653-.62 31.326 13.054l32 34.239q11.674 12.913 11.174 29.565-.5 16.653-13.174 29.327-12.673 12.674-28.826 12.554-16.152-.12-28.826-12.794ZM480-240q-100 0-170-70t-70-170q0-100 70-170t170-70q100 0 170 70t70 170q0 100-70 170t-170 70Zm-.247-82q65.703 0 111.475-46.272Q637-414.544 637-480.247t-45.525-111.228Q545.95-637 480.247-637t-111.475 45.525Q323-545.95 323-480.247t45.525 111.975Q414.05-322 479.753-322ZM481-481Z"/></svg></span>
      <span class="dark-mode-icon"><svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M480.239-116.413q-152.63 0-258.228-105.478Q116.413-327.37 116.413-480q0-130.935 77.739-227.435t206.304-125.043q43.022-9.631 63.87 10.869t3.478 62.805q-8.891 22.043-14.315 44.463-5.424 22.42-5.424 46.689 0 91.694 64.326 155.879 64.325 64.186 156.218 64.186 24.369 0 46.978-4.946 22.609-4.945 44.413-14.076 42.826-17.369 62.967 1.142 20.142 18.511 10.511 61.054Q807.174-280 712.63-198.206q-94.543 81.793-232.391 81.793Zm0-95q79.783 0 143.337-40.217 63.554-40.218 95.793-108.283-15.608 4.044-31.097 5.326-15.49 1.283-31.859.805-123.706-4.066-210.777-90.539-87.071-86.473-91.614-212.092-.24-16.369.923-31.978 1.164-15.609 5.446-30.978-67.826 32.478-108.282 96.152Q211.652-559.543 211.652-480q0 111.929 78.329 190.258 78.329 78.329 190.258 78.329ZM466.13-465.891Z"/></svg></span>
    </a>
    
      <a id="nav-rss-link" class="nav-icon mobile-hide" href="/atom.xml" title="RSS 订阅">
        <svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M198-120q-25.846 0-44.23-18.384-18.384-18.385-18.384-44.23 0-25.846 18.384-44.23 18.384-18.385 44.23-18.385 25.846 0 44.23 18.385 18.384 18.384 18.384 44.23 0 25.845-18.384 44.23Q223.846-120 198-120Zm538.385 0q-18.846 0-32.923-13.769-14.076-13.769-15.922-33.23-8.692-100.616-51.077-188.654-42.385-88.039-109.885-155.539-67.5-67.501-155.539-109.885Q283-663.462 182.385-672.154q-19.461-1.846-33.23-16.23-13.769-14.385-13.769-33.846t14.076-32.922q14.077-13.461 32.923-12.23 120.076 8.692 226.038 58.768 105.961 50.077 185.73 129.846 79.769 79.769 129.846 185.731 50.077 105.961 58.769 226.038 1.231 18.846-12.538 32.922Q756.461-120 736.385-120Zm-252 0q-18.231 0-32.423-13.461t-18.653-33.538Q418.155-264.23 348.886-333.5q-69.27-69.27-166.501-84.423-20.077-4.462-33.538-18.961-13.461-14.5-13.461-33.346 0-19.076 13.884-33.23 13.884-14.153 33.115-10.922 136.769 15.384 234.384 112.999 97.615 97.615 112.999 234.384 3.231 19.23-10.538 33.115Q505.461-120 484.385-120Z"/></svg>
      </a>
    
    <div id="nav-menu-btn" class="nav-icon">
      <svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M177.37-252.282q-17.453 0-29.477-11.964-12.024-11.963-12.024-29.326t12.024-29.537q12.024-12.174 29.477-12.174h605.26q17.453 0 29.477 11.964 12.024 11.963 12.024 29.326t-12.024 29.537q-12.024 12.174-29.477 12.174H177.37Zm0-186.218q-17.453 0-29.477-11.963-12.024-11.964-12.024-29.326 0-17.363 12.024-29.537T177.37-521.5h605.26q17.453 0 29.477 11.963 12.024 11.964 12.024 29.326 0 17.363-12.024 29.537T782.63-438.5H177.37Zm0-186.217q-17.453 0-29.477-11.964-12.024-11.963-12.024-29.326t12.024-29.537q12.024-12.174 29.477-12.174h605.26q17.453 0 29.477 11.964 12.024 11.963 12.024 29.326t-12.024 29.537q-12.024 12.174-29.477 12.174H177.37Z"/></svg>
    </div>
  </nav>
</navbar>
<div id="nav-dropdown" class="hidden">
  <div id="dropdown-link-list">
    
      <a class="nav-dropdown-link" href="/">Home</a>
    
      <a class="nav-dropdown-link" href="/archives">Archives</a>
    
      <a class="nav-dropdown-link" href="/links">Links</a>
    
      <a class="nav-dropdown-link" target="_blank" rel="noopener" href="https://15g4759r53.goho.co">Charge</a>
    
      <a class="nav-dropdown-link" href="/game_2048">Game</a>
    
      <a class="nav-dropdown-link" href="/about">About</a>
    
    
      <a class="nav-dropdown-link" href="/atom.xml" title="RSS 订阅">RSS</a>
     
    </div>
</div>
<script>
  let dropdownBtn = document.getElementById("nav-menu-btn");
  let dropdownEle = document.getElementById("nav-dropdown");
  dropdownBtn.onclick = function() {
    dropdownEle.classList.toggle("hidden");
  }
</script>
    </div>
    <div id="sidebar-wrapper">
      <sidebar id="sidebar">
  
    <div class="widget-wrap">
  <div class="info-card">
    <div class="avatar">
      
        <image src=/images/5.jpg></image>
      
      <div class="img-dim"></div>
    </div>
    <div class="info">
      <div class="username">一秋小风 </div>
      <div class="dot"></div>
      <div class="subtitle">A blog for documenting study </div>
      <div class="link-list">
        
          <a class="link-btn" target="_blank" rel="noopener" href="https://twitter.com" title="Twitter"><i class="fa-brands fa-twitter"></i></a>
        
          <a class="link-btn" target="_blank" rel="noopener" href="https://store.steampowered.com" title="Steam"><i class="fa-brands fa-steam"></i></a>
        
          <a class="link-btn" target="_blank" rel="noopener" href="https://github.com/vaeyer" title="GitHub"><i class="fa-brands fa-github"></i></a>
         
      </div>  
    </div>
  </div>
</div>

  
  <div class="sticky">
    
      


  <div class="widget-wrap">
    <div class="widget">
      <h3 class="widget-title">分类</h3>
      <div class="category-box">
            <a class="category-link" href="/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/">
                树莓派
                <div class="category-count">1</div>
            </a>
        
            <a class="category-link" href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">
                数据结构
                <div class="category-count">1</div>
            </a>
        </div>
    </div>
  </div>


    
      
  <div class="widget-wrap">
    <div class="widget">
      <h3 class="widget-title">标签</h3>
      <ul class="widget-tag-list" itemprop="keywords"><li class="widget-tag-list-item"><a class="widget-tag-list-link" href="/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" rel="tag">数据结构</a></li><li class="widget-tag-list-item"><a class="widget-tag-list-link" href="/tags/%E6%A0%91%E8%8E%93%E6%B4%BE%E9%85%8D%E7%BD%AE/" rel="tag">树莓派配置</a></li></ul>
    </div>
  </div>


    
      
  <div class="widget-wrap">
    <div class="widget">
      <h3 class="widget-title">归档</h3>
      
      
        <a class="archive-link" href="/archives/2023/09 ">
          九月 2023 
          <div class="archive-count">1 </div>
        </a>
      
        <a class="archive-link" href="/archives/2023/08 ">
          八月 2023 
          <div class="archive-count">2 </div>
        </a>
      
    </div>
  </div>


    
      
  <div class="widget-wrap">
    <div class="widget">
      <h3 class="widget-title">最新文章</h3>
      <ul>
        
          <a class="recent-link" href="/2023/09/17/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E7%AC%94%E8%AE%B0/" title="数据结构笔记" >
            <div class="recent-link-text">
              数据结构笔记
            </div>
          </a>
        
          <a class="recent-link" href="/2023/08/25/raspberry_one/" title="树莓派基础配置及常见问题" >
            <div class="recent-link-text">
              树莓派基础配置及常见问题
            </div>
          </a>
        
          <a class="recent-link" href="/2023/08/16/hello-world/" title="Hello World" >
            <div class="recent-link-text">
              Hello World
            </div>
          </a>
        
      </ul>
    </div>
  </div>

    
  </div>
</sidebar>
    </div>
    <div id="content-body">
       


<article id="post-raspberry_one" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  
    
   
  <div class="article-inner">
    <div class="article-main">
      <header class="article-header">
        
<div class="main-title-bar">
  <div class="main-title-dot"></div>
  
    
      <h1 class="p-name article-title" itemprop="headline name">
        树莓派基础配置及常见问题
      </h1>
    
  
</div>

        <div class='meta-info-bar'>
          <div class="meta-info">
  <time class="dt-published" datetime="2023-08-25T05:28:06.000Z" itemprop="datePublished">2023-08-25</time>
</div>
          <div class="need-seperator meta-info">
            <div class="meta-cate-flex">
  
  <a class="meta-cate-link" href="/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/">树莓派</a>
   
</div>
  
          </div>
          <div class="wordcount need-seperator meta-info">
            1.4k 词 
          </div>
        </div>
        
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%A0%91%E8%8E%93%E6%B4%BE%E9%85%8D%E7%BD%AE/" rel="tag">树莓派配置</a></li></ul>

      </header>
      <div class="e-content article-entry" itemprop="articleBody">
        
          <h3 id="一安装树莓派系统及配置树莓派">一、安装树莓派系统及配置树莓派</h3>
<h4 id="下载树莓派系统">下载树莓派系统</h4>
<h5>
Raspberry Pi OS（Raspbian）：
</h5>
<h6>
下载地址
</h6>
<pre><code>https://downloads.raspberrypi.org/raspios_armhf_latest</code></pre>
<h6>
默认账号：
</h6>
<p>  <font size="2"><strong>Username</strong>: <code>pi</code>
<strong>Password</strong>: <code>raspberry</code></font></p>
<h5>
Ubuntu MATE for the Raspberry Pi：
</h5>
<h6>
下载地址：
</h6>
<pre><code>https://make.quwj.com/bookmark/334/go</code></pre>
<h6>
默认账号：
</h6>
   <font size="2"><strong>Username</strong>: <code>ubuntu</code>
<strong>Password</strong>: <code>ubuntu</code></font>
<h5>
Kali Linux for Pi：
</h5>
<h6>
下载地址：
</h6>
<pre><code>https://kali.download/arm-images/kali-2022.4/kali-linux-2022.4-raspberry-pi-armhf.img.xz（32位）
https://kali.download/arm-images/kali-2022.4/kali-linux-2022.4-raspberry-pi-arm64.img.xz（64位）</code></pre>
<h4 id="下载格式化sd卡工具sd-card-formatter并格式化sd卡">下载格式化SD卡工具（SD
Card Formatter），并格式化SD卡</h4>
<h6>
下载地址：
</h6>
<pre><code>     https://www.sdcard.org/</code></pre>
<p>下载安装完成后，插入SD卡，打开软件，点击“Format” 即可。</p>
<h4 id="下载系统烧录软件win32-disk-imager">下载系统烧录软件（Win32 Disk
Imager）</h4>
<h6>
下载地址：
</h6>
<pre><code>    https://sourceforge.net/projects/win32diskimager/</code></pre>
<p>解压下载好的zip文件得到.img镜像文件然后选好系统文件，选择SD卡设备，点击“写入”。</p>
<h4 id="等待完成">等待完成</h4>
<h4 id="树莓派新系统ssh连接被拒绝的解决方法">树莓派新系统SSH连接被拒绝的解决方法</h4>
<p>把SD卡拔下来，在电脑下进入到根目录(boot)，新建一个名为ssh的空白文件。</p>
<h4 id="树莓派进行ssh连接">树莓派进行ssh连接</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo service ssh start    #打开ssh服务</span><br><span class="line"></span><br><span class="line">ssh [用户名]@ip地址 -p 端口号</span><br></pre></td></tr></table></figure>
<h4 id="linux更换国内源">Linux更换国内源</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">sudo nano /etc/apt/sources.list</span><br><span class="line"></span><br><span class="line">    deb https://xxxxxxxxxxxxxxxxx</span><br><span class="line">    deb-src https://xxxxxxxxxxxxxx</span><br><span class="line"></span><br><span class="line">sudo apt-get update &amp;&amp; apt-get upgrade</span><br><span class="line"></span><br><span class="line">sudo apt-get dist-upgrade   #重新安装未能安装的应用</span><br></pre></td></tr></table></figure>
<h4 id="提权">提权</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">sudo su    #初始化密码可能为：toor</span><br><span class="line"></span><br><span class="line">sudo passwd</span><br><span class="line"></span><br><span class="line">[sudo] password for xxx:</span><br><span class="line"></span><br><span class="line">（输入新的root密码）</span><br><span class="line"></span><br><span class="line">（确认密码）</span><br></pre></td></tr></table></figure>
<h3 id="二树莓派3b-hdmi不能正常显示">二、树莓派3b HDMI不能正常显示</h3>
<p>  与传统PC不同，树莓派使用<code>config</code>文件来代替传统PC中的BIOS界面，系统配置参数不是使用<code>BIOS（ Basic Input/Output System）</code>进行编辑和存储的，而是存储在一个名为<code>config.txt</code>的可选文本文件中，在ARM
CPU和Linux被初始化之前，这是由GPU读取的。因此，它必须位于SD卡的第一个(引导)分区上，与引导代码一起。在
<code>bootcode.bin</code> 和 <code>start.elf</code>
文件的旁边。这个文件通常可以作为<code>/boot/config</code>访问，必须使用root进行编辑。</p>
<h4 id="将sd中的config.txt文件内容替换成">将sd中的config.txt文件内容替换成</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">hdmi_force_hotplug=1</span><br><span class="line"></span><br><span class="line">config_hdmi_boost=4</span><br><span class="line"></span><br><span class="line">hdmi_group=2</span><br><span class="line"></span><br><span class="line">hdmi_mode=9</span><br><span class="line"></span><br><span class="line">hdmi_drive=2</span><br><span class="line"></span><br><span class="line">hdmi_ignore_edid=0xa5000080</span><br><span class="line"></span><br><span class="line">disable_overscan=1</span><br></pre></td></tr></table></figure>
<h3 id="三树莓派非官方系统解决-sudo-raspi-config-command-not-found-问题">三、树莓派非官方系统解决
sudo: raspi-config: command not found 问题</h3>
<h4 id="手动下载deb包">手动下载deb包</h4>
<pre><code>wget http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20221214_all.deb</code></pre>
<h4 id="解决依赖问题">解决依赖问题</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install lua5.1 libatopology2 libfftw3-single3 libsamplerate0 alsa-utils</span><br></pre></td></tr></table></figure>
<h4 id="安装软件">安装软件</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo dpkg -i raspi-config_20221214_all.deb</span><br></pre></td></tr></table></figure>
<h4 id="运行raspi-config需要sudo或以上权限">运行raspi-config，需要sudo或以上权限</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo raspi-config</span><br></pre></td></tr></table></figure>
<h4 id="raspi-config能够运行的还有一个重要前提boot分区已被正常挂载">raspi-config能够运行的还有一个重要前提，boot分区已被正常挂载</h4>
<h5 id="先查看一下boot分区所在设备号">（1）先查看一下boot分区所在设备号</h5>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">fdisk -l</span><br></pre></td></tr></table></figure>
<h5 id="再把它挂载到boot上以下是示例不一定是mmcblk0p6需根据实际情况决定">（2）
再把它挂载到/boot上(以下是示例，不一定是mmcblk0p6，需根据实际情况决定)</h5>
<h6>
参考：
</h6>
<pre><code>https://blog.csdn.net/qq_25231683/article/details/120018282</code></pre>
<h3 id="四树莓派扩容">四、树莓派扩容</h3>
<p>  当树莓派默认的系统空间已经被占满，无法再进行安装等操作，而
SD卡仍有空间未被使用，可以对树莓派进行扩容。</p>
<p>  假设一个镜像的大小为 4G，由于该镜像对内存卡的要求是大于或等于
4G，但对于 4G以上的内存卡来说，树莓派的系统只利用到
4G，因此才有了扩容这种操作。</p>
<h4 id="扩容步骤">扩容步骤：</h4>
<p>  使用树莓派自带的工具可以快速将树莓派挂载所有的
SD卡空间，将系统分区扩展到 SD卡的最大容量。</p>
<h5 id="打开raspi-config系统配置工具">（1）打开raspi-config系统配置工具</h5>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo raspi-config</span><br></pre></td></tr></table></figure>
<h5 id="选择advancd-options">（2）选择Advancd Options：</h5>
<h5 id="选择expand-filesystem">（3）选择Expand Filesystem：</h5>
<h5 id="ok">（4）Ok：</h5>
<h5 id="重启树莓派">（5）重启树莓派</h5>
<h6>
参考：
</h6>
<pre><code>https://blog.csdn.net/lcx1837/article/details/114156732</code></pre>
<h3 id="五超简单的树莓派sd卡扩容方案将树莓派16gb的sd卡克隆到64gb的sd卡">五、超简单的树莓派SD卡扩容方案，将树莓派16GB的SD卡克隆到64GB的SD卡</h3>
<h6>
参考链接：
</h6>
<pre><code>https://blog.csdn.net/zhuoyuedelan/article/details/120684117</code></pre>
<h3 id="六解决zshcommand-not-found问题">六、解决zsh：command not
found问题</h3>
<p><code>zsh: command not found:意思就是找不到这个命令，缺少环境变量的配置</code></p>
<h4 id="打开zsh配置文件">打开zsh配置文件</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo nano ~/.zshrc</span><br></pre></td></tr></table></figure>
<h4 id="添加缺少的文件路径">添加缺少的文件路径</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">PATH="/usr/bin:$PATH"</span><br><span class="line"></span><br><span class="line">export PATH</span><br></pre></td></tr></table></figure>
<h4 id="关闭窗口执行">关闭窗口执行</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">source ~/.zshrc</span><br></pre></td></tr></table></figure>
<h4 id="验证是否配置成功">验证是否配置成功</h4>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">allure --version</span><br></pre></td></tr></table></figure>
<p>  在pycharm中验证安装成功是一样的方法，如果在终端验证成功，pycharm验证不成功，重启pycharm。</p>
<h3 id="七ssh连接失败解决-host-key-verification-failed.">七、SSH连接失败，解决
Host key verification failed.</h3>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -R 你要访问的IP地址</span><br></pre></td></tr></table></figure>
<h3 id="八树莓派打开vnc服务">八、树莓派打开vnc服务</h3>
  树莓派命令行中，输入： <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo raspi-config</span><br></pre></td></tr></table></figure>
  这会儿会打开一个图形化界面，界面中使用方向键控制光标，Enter键进行选择。需要说明的是，如果下面的说明中，你的树莓派没有对应选项，那可能因为版本原因，选项在不同的入口。否则的话请忽略。
<h6>
配置步骤：
</h6>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">（1）打开VNC：Interfacing Options -&gt; VNC -&gt; Yes</span><br><span class="line"></span><br><span class="line">（2）退出图形化界面：（左右方向键选择）Finish。这时，无需重启即可使用vnc服务</span><br></pre></td></tr></table></figure>
<h3 id="九解决host-key-verification-failed.">九、解决Host key
verification failed.</h3>
<p>  SSh连接树莓派时出现 <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Host key for 192.168.1.x has changed and you have requested strict checking.</span><br><span class="line"></span><br><span class="line">Host key verification failed.</span><br></pre></td></tr></table></figure>
  这种情况一般是你重置过你的服务器后，你再次访问时Host
key对不上，重置一下就好。</p>
<h6>
解决办法：
</h6>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -R 你要访问的IP地址     </span><br></pre></td></tr></table></figure>
<h3 id="十linux常用命令">十、Linux常用命令</h3>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br></pre></td><td class="code"><pre><span class="line">#查看ip地址</span><br><span class="line"></span><br><span class="line">ip a</span><br><span class="line"></span><br><span class="line">ip addr</span><br><span class="line"></span><br><span class="line">ifconfig</span><br><span class="line"></span><br><span class="line">#ping网络(测试网络连通)</span><br><span class="line"></span><br><span class="line">ping</span><br><span class="line"></span><br><span class="line">#查看系统时间</span><br><span class="line"></span><br><span class="line">date</span><br><span class="line"></span><br><span class="line">#注销</span><br><span class="line"></span><br><span class="line">logout</span><br><span class="line"></span><br><span class="line">#关机</span><br><span class="line"></span><br><span class="line">shutdown now</span><br><span class="line"></span><br><span class="line">#重启</span><br><span class="line"></span><br><span class="line">reboot</span><br><span class="line"></span><br><span class="line">#清屏</span><br><span class="line"></span><br><span class="line">clear</span><br><span class="line"></span><br><span class="line">#查看磁盘空间大小</span><br><span class="line"></span><br><span class="line">df -h</span><br><span class="line"></span><br><span class="line">#查看内存剩余空间大小</span><br><span class="line"></span><br><span class="line">free -m</span><br><span class="line"></span><br><span class="line">#查看文件内容</span><br><span class="line"></span><br><span class="line">cat</span><br><span class="line"></span><br><span class="line">#查看进程</span><br><span class="line"></span><br><span class="line">ps -a</span><br><span class="line"></span><br><span class="line">ps -e</span><br><span class="line"></span><br><span class="line">top</span><br><span class="line"></span><br><span class="line">#结束进程</span><br><span class="line"></span><br><span class="line">kill pid</span><br></pre></td></tr></table></figure>

        
      </div>

         
    </div>
    
     
  </div>
  
    
<nav id="article-nav">
  <a class="article-nav-btn left "
    
      href="/2023/09/17/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E7%AC%94%E8%AE%B0/"
      title="数据结构笔记"
     >
    <i class="fa-solid fa-angle-left"></i>
    <p class="title-text">
      
        数据结构笔记
        
    </p>
  </a>
  <a class="article-nav-btn right "
    
      href="/2023/08/16/hello-world/"
      title="Hello World"
     >

    <p class="title-text">
      
        Hello World
        
    </p>
    <i class="fa-solid fa-angle-right"></i>
  </a>
</nav>


  
</article>


  
  <script src='//unpkg.com/valine/dist/Valine.min.js'></script>
  <div id="comment-card" class="comment-card">
    <div class="main-title-bar">
      <div class="main-title-dot"></div>
      <div class="main-title">留言 </div>
    </div>
    <div id="vcomments"></div>
  </div>
  <script>
      new Valine({"enable":true,"appId":"UVYVZIRxRmzkEGCDGiBk2mPU-9Nh9j0Va","appKey":"O5KsCA7QGTvMc6BWZUO5XtDo","placeholder":"留言仅限讨论，禁止广告等行为","pageSize":10,"highlight":true,"serverURLs":"https://uvyvzirx.lc-cn-e1-shared.com","el":"#vcomments"});
  </script>




    </div>
    <div id="footer-wrapper">
      <footer id="footer">
  
  <div id="footer-info" class="inner">
    
    &copy; 2024 一秋小风<br>
    Powered by <a href="https://hexo.io/" target="_blank">Hexo</a> & Theme <a target="_blank" rel="noopener" href="https://github.com/saicaca/hexo-theme-vivia">Vivia</a>
  </div>
</footer>

    </div>
    <div class="back-to-top-wrapper">
    <button id="back-to-top-btn" class="back-to-top-btn hide" onclick="topFunction()">
        <i class="fa-solid fa-angle-up"></i>
    </button>
</div>

<script>
    function topFunction() {
        window.scroll({ top: 0, behavior: 'smooth' });
    }
    let btn = document.getElementById('back-to-top-btn');
    function scrollFunction() {
        if (document.body.scrollTop > 600 || document.documentElement.scrollTop > 600) {
            btn.classList.remove('hide')
        } else {
            btn.classList.add('hide')
        }
    }
    window.onscroll = function() {
        scrollFunction();
    }
</script>

  </div>
  <script src="/js/light-dark-switch.js"></script>
<!-- hexo injector body_end start -->
  <div id="aplayer"></div>
  <link defer rel="stylesheet" href="https://cdn.staticfile.org/aplayer/1.10.1/APlayer.min.css" />
  <script src="https://cdn.staticfile.org/aplayer/1.10.1/APlayer.min.js"></script>
  <script defer src="/js/aplayer.js"></script>

<!-- hexo injector body_end end --></body>
</html>
